{% extends 'base.html' %}
{% block title %}登录{% endblock %}
{% block head %}
    <script>
        function register() {
            window.location.assign("{{ url_for('auth.register') }}");
        }
    </script>
{% endblock %}
{% block content %}
    <form action="{{ url_for('auth.login') }}" method="post">
        <div class="form-group">
            <label for="user">用户名/邮箱:</label>
            <input type="text" class="form-control" id="user" placeholder="Enter username" required="required" name="user">
        </div>
        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" class="form-control" id="password" placeholder="Enter password" required="required" name="password">
        </div>
        <p class="text-danger">{{ error }}</p>
        <button type="submit" class="btn btn-primary">登录</button>
        <button type="button" class="btn btn-primary" onclick="register()">注册</button>
    </form>
{% endblock %}